package com.campus.server.service;

import com.campus.common.vo.Book;
import com.campus.common.vo.Student;
import com.campus.server.dao.StudentAccountManagementDao;
import com.campus.server.dao.StudentDao;
import java.util.List;

public class StudentAccountMangementService {
    private StudentAccountManagementDao studentAccountManagementDao = new StudentAccountManagementDao();
    private StudentDao studentDao = new StudentDao();

    public List<Student> listStudents() {
        return studentAccountManagementDao.listAllStudents();
    }

    public boolean addStudent(Student student){return studentDao.isRegister(student.getStudentId(), "123456",student);}

    public boolean deleteStudent(String studentId) {return studentAccountManagementDao.deleteStudent(studentId);}

    public Student getStudenstById(String studentId) {return studentAccountManagementDao.getStudentById(studentId);}

    public List<Student> searchStudentsByName(String name){return studentAccountManagementDao.searchStudentsByName(name);}

    public List<Student> searchStudentById(String studentId){return studentAccountManagementDao.searchStudentsById(studentId);}

    public List<Student> searchStudents(String studentId, String name) {return studentAccountManagementDao.searchStudents(studentId, name);}

    public boolean updateStudent(Student student) {return studentAccountManagementDao.updateStudent(student);}

    public boolean studentExists(String studentId) {return studentAccountManagementDao.studentExists(studentId);}
}
